<template>
    <div id="main-center">
      <div id="group-div">
        <div class="group-div-title">模板类型<span>*注：请上传word格式的文件</span></div>
        <div class="group-div-content">
          <el-table :data="tableData" class="group-table" border>
            <el-table-column prop="tempName" label="协议模板名称" width="160" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="fileUrl" label="文件名称" width="160" align="center" :formatter="formatUrl" show-overflow-tooltip></el-table-column>
            <el-table-column prop="downloadCount" label="下载数" width="150" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="uploadTime" label="上传日期" width="180" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column label="操作" min-width="200" align="center">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                <el-button
                  size="mini"
                  type="danger"
                  @click="handleDelete(scope.$index, scope.row)">删除</el-button>
              </template>
              <!-- <template slot-scope="scope">
                <el-upload
                  style="display: inline;position: absolute"
                  class="upload-demo"
                  :action=uploadUrl
                  :on-change="handleChange"
                  :on-success="handleSuccess"
                  :on-error="handleError"
                  :beforeUpload="beforeAvatarUpload"
                  :show-file-list=false
                  :with-credentials="true"
                  :data="{tempCode: scope.row.tempCode}"
                  :file-list="fileList">
                  <el-button size="mini" type="primary">上传文件</el-button>
                </el-upload>
                <el-button style="margin-left: 90px;" class="while-button" size="mini" type="primary" plain @click="deleteTemplate(scope.row.tempCode)">删除文件</el-button>
              </template> -->
            </el-table-column>
          </el-table>
        </div>
        <div class="group-div-title" style="margin-top: 30px">租售说明</div>
        <div class="group-div-content">
          <div class="pos-div">
            <el-input type="textarea" maxlength="1000" :rows="10" placeholder="请输入相关的租售说明..." v-model="textRecord" class="main-textarea"/>
            <el-button size="mini" type="primary" class="main-button" @click="pushSaleRentRecord">确认发布</el-button>
          </div>
        </div>
      </div>
    </div>
</template>

<script>
  import BasicModal from '../../../components/widgets/BasicModal';
  import common from '../../../mixins/common.js';
  import crypto from '../../../mixins/crypto.js';
  import invokeModal from '../../../mixins/modal/invokeModal.js';
  import getSearchOptions from '../../../mixins/list/getCommonTypes.js';
  import {count, deepCopyObj} from '../../../assets/js/help.js';
  import list from './js/list.js'

  export default {
    mixins: [common, crypto, invokeModal, getSearchOptions, list],
    components: {
      'basic-modal': BasicModal
    }
  }
</script>

<style scoped>
  @import '../../../assets/less/list.less';

  .while-button {
    background-color: #ffffff;
  }

  .while-button:hover {
    background-color: #409EFF;
    color: #ffffff;
  }
</style>
